/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package quinnectViews;

import javax.swing.JLabel;
import javax.swing.JTextField;

/**
 *
 * @author Prophet
 */
public class Widget extends javax.swing.JFrame {

    /**
     * Creates new form Widget
     */
    public Widget() {
        initComponents();
        
    }
    
    public JLabel getMain(){
        return mainIcon;
    }
    
    public JLabel getTop(){
        return topIcon;
    }
    
    public JLabel getBottom(){
        return bottomIcon;
    }
    
    public static int xPos(){
        return currPosnX;
    }
    
    public static int yPos(){
        return currPosnY;
    }
    
    public JTextField getSearchField(){
        return searchField;
    }
    
    public JLabel getTextBoard(){
        return placeHolder;
    }
    
    int xMouse, yMouse;
    static int currPosnX,currPosnY;
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        bottomIcon = new javax.swing.JLabel();
        topIcon = new javax.swing.JLabel();
        mainIcon = new javax.swing.JLabel();
        searchField = new javax.swing.JTextField();
        placeHolder = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setAlwaysOnTop(true);
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        bottomIcon.setIcon(new javax.swing.ImageIcon(getClass().getResource("/quinnectViews/icons/youtube_small_transparent.png"))); // NOI18N
        bottomIcon.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
            public void mouseDragged(java.awt.event.MouseEvent evt) {
                bottomIconMouseDragged(evt);
            }
        });
        bottomIcon.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                bottomIconMousePressed(evt);
            }
        });
        getContentPane().add(bottomIcon, new org.netbeans.lib.awtextra.AbsoluteConstraints(330, 240, -1, 60));

        topIcon.setIcon(new javax.swing.ImageIcon(getClass().getResource("/quinnectViews/icons/twitter_small_transparent.png"))); // NOI18N
        topIcon.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
            public void mouseDragged(java.awt.event.MouseEvent evt) {
                topIconMouseDragged(evt);
            }
        });
        topIcon.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                topIconMousePressed(evt);
            }
        });
        getContentPane().add(topIcon, new org.netbeans.lib.awtextra.AbsoluteConstraints(330, 150, -1, 60));

        mainIcon.setIcon(new javax.swing.ImageIcon(getClass().getResource("/quinnectViews/icons/google_big.png"))); // NOI18N
        mainIcon.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
            public void mouseDragged(java.awt.event.MouseEvent evt) {
                mainIconMouseDragged(evt);
            }
        });
        mainIcon.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                mainIconMousePressed(evt);
            }
        });
        getContentPane().add(mainIcon, new org.netbeans.lib.awtextra.AbsoluteConstraints(290, 188, 70, 70));

        searchField.setBackground(new java.awt.Color(255, 255, 255));
        searchField.setFont(new java.awt.Font("Myriad Pro", 0, 14)); // NOI18N
        searchField.setForeground(new java.awt.Color(51, 51, 51));
        searchField.setBorder(null);
        getContentPane().add(searchField, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 210, 170, 20));

        placeHolder.setIcon(new javax.swing.ImageIcon(getClass().getResource("/quinnectViews/icons/google_board.png"))); // NOI18N
        getContentPane().add(placeHolder, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 190, 240, 60));

        setBounds(800, 800, 416, 339);
    }// </editor-fold>//GEN-END:initComponents

    private void bottomIconMouseDragged(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_bottomIconMouseDragged
        // TODO add your handling code here:
        int x = evt.getXOnScreen();
        int y = evt.getYOnScreen();
        this.setLocation(x - xMouse, y - yMouse);        
        currPosnX = (x - xMouse);
        currPosnY = (y - yMouse);
    }//GEN-LAST:event_bottomIconMouseDragged

    private void bottomIconMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_bottomIconMousePressed
        // TODO add your handling code here:
        xMouse = evt.getX() + 330;
        yMouse = evt.getY() + 250;        
    }//GEN-LAST:event_bottomIconMousePressed

    private void topIconMouseDragged(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_topIconMouseDragged
        // TODO add your handling code here:
        int x = evt.getXOnScreen();
        int y = evt.getYOnScreen();
        this.setLocation(x - xMouse, y - yMouse);        
        currPosnX = (x - xMouse);
        currPosnY = (y - yMouse);
    }//GEN-LAST:event_topIconMouseDragged

    private void topIconMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_topIconMousePressed
        // TODO add your handling code here:
        xMouse = evt.getX() + 330;
        yMouse = evt.getY() + 150;
    }//GEN-LAST:event_topIconMousePressed

    private void mainIconMouseDragged(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_mainIconMouseDragged
        // TODO add your handling code here:
        int x = evt.getXOnScreen();
        int y = evt.getYOnScreen();
        this.setLocation(x - xMouse, y - yMouse);        
        currPosnX = (x - xMouse);
        currPosnY = (y - yMouse);
    }//GEN-LAST:event_mainIconMouseDragged

    private void mainIconMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_mainIconMousePressed
        // TODO add your handling code here:
        xMouse = evt.getX() + 285;
        yMouse = evt.getY() + 200;
    }//GEN-LAST:event_mainIconMousePressed

    /**
     * @param args the command line arguments
     */
//    public static void main(String args[]) {
//        /* Set the Nimbus look and feel */
//        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
//        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
//         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
//         */
//        try {
//            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
//                if ("Nimbus".equals(info.getName())) {
//                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
//                    break;
//                }
//            }
//        } catch (ClassNotFoundException ex) {
//            java.util.logging.Logger.getLogger(Widget.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (InstantiationException ex) {
//            java.util.logging.Logger.getLogger(Widget.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (IllegalAccessException ex) {
//            java.util.logging.Logger.getLogger(Widget.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
//            java.util.logging.Logger.getLogger(Widget.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        }
//        //</editor-fold>
//
//        /* Create and display the form */
//        java.awt.EventQueue.invokeLater(new Runnable() {
//            public void run() {
//                new Widget().setVisible(true);
//            }
//        });
//    }

    
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel bottomIcon;
    private javax.swing.JLabel mainIcon;
    private javax.swing.JLabel placeHolder;
    private javax.swing.JTextField searchField;
    private javax.swing.JLabel topIcon;
    // End of variables declaration//GEN-END:variables
}
